﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace LogModel
{
    [DataContract]
    public class JobRecord
    {
        [DataMember]
        public int id { get; set; }

        [DataMember]
        public int tid { get; set; }

        [DataMember]
        public int processId { get; set; }

        [DataMember]
        public DateTime creatTime { get; set; }

        [DataMember]
        public string guid { get; set; }

        [DataMember]
        public string module { get; set; }

        [DataMember]
        public string ywbh { get; set; }

        [DataMember]
        public string isTestMode { get; set; }

        [DataMember]
        public DateTime beginTime { get; set; }

        [DataMember]
        public DateTime endTime { get; set; }

        [DataMember]
        public DateTime updateTime { get; set; }

        [DataMember]
        public string cancellFlag { get; set; }

        [DataMember]
        public string cancellReason { get; set; }

        [DataMember]
        public string finishFlag { get; set; }

        [DataMember]
        public string errorFlag { get; set; }

        [DataMember]
        public int errorCode { get; set; }

        [DataMember]
        public string errorMessage { get; set; }

        [DataMember]
        public string userID { get; set; }

        [DataMember]
        public string userName { get; set; }

        [DataMember]
        public string lastStatus { get; set; }

        [DataMember]
        public string output { get; set; }

        [DataMember]
        public string remark { get; set; }

        [DataMember]
        public string applyData { get; set; }

        [DataMember]
        public string receiveData { get; set; }

        public JobRecord(int tId, bool testMode=false)
        {
            ywbh = "";
            tid = tId;
            isTestMode = (testMode ? "1" : "0");
            guid = Guid.NewGuid().ToString();
            creatTime = DateTime.Now;
            lastStatus = "已创建";
            cancellFlag = "0";
            errorCode = 0x00000000;
            finishFlag = "0";
            errorFlag = "0";
            ywbh = "";
            remark = "";
            output = "";
            applyData = "";
            receiveData = "";
        }

        public JobRecord()
        {
            ywbh = "";
            isTestMode = "0";
            guid = Guid.NewGuid().ToString();
            creatTime = DateTime.Now;
            lastStatus = "已创建";
            cancellFlag = "0";
            errorCode = 0x00000000;
            finishFlag = "0";
            errorFlag = "0";
            ywbh = "";
            remark = "";
            output = "";
            applyData = "";
            receiveData = "";
        }
    }
}
